package org.zanpu.timer.thread.service;

import org.springframework.stereotype.Service;
import org.zanpu.timer.thread.interf.ExecutorThread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 线程管理
 * Created by MD on 2016/12/28.
 */
@Service("executorThread")
public class ExecutorThreadService implements ExecutorThread {

    private ExecutorService service = Executors.newCachedThreadPool(); //缓存线程池

    public void run(Runnable command) {
        service.execute(command);
    }
}
